/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package PV112;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Erik
 */
public class MoveXThreadAnimator implements Runnable {

    private double x, prevX, amntX = 0;
    
    @Override
    public void run() {
        while (true){
            if (prevX > amntX){
                x += .2f;
            }else{
                x -= .2f;
            }
            prevX = amntX;
        try {
            Thread.sleep(20);
        } catch (InterruptedException ex) {
            Logger.getLogger(MoveXThreadAnimator.class.getName()).log(Level.SEVERE, null, ex);
        }    
        }
    }

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public void setAmntX(double amntX) {
        this.amntX = amntX;
    }
    
}
